package com.boolib.shopweb.web;

import com.boolib.commons.entity.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    RedisTemplate redisTemplate;



    @GetMapping("set")
    public ServerResponse serverResponse(String key, String val){
        redisTemplate.opsForValue().set(key,val);

        return ServerResponse.createBySuccess(redisTemplate.opsForValue().get(key));
    }
}
